$(document).ready(function(){     
    $('#search3').keyup(function(e){         
        if(e.which == 13){
            e.preventDefault();
        }
        var searched = $('#search3').val();
        var fullurl = $('#hiddenurl3').val() + 'index.php/configuraciones/getResult_Horario/' + searched;
        $.getJSON(fullurl,function(result){
            $.getJSON(fullurl,function(result){
                var elements = [];
                $.each(result,function(i,val){
                    elements.push(val.nombre+', '+val.id);
                })
                    
                $('#search3').autocomplete({                    
                    source : elements
                })
            })
        })        
    })    
});

